//
//  Dawn.swift
//  DawnFoundation
//
//  Created by 崔成成 on 2021/8/14.
//

import UIKit

public struct DawnWrapper<Base> {
    public let base: Base
    public init(_ base: Base) {
        self.base = base
    }
}

public protocol DawnCompatible: AnyObject { }

/// Represents a value type that is compatible with Dawn. You can use `kf` property to get a
/// value in the namespace of Dawn.
public protocol DawnCompatibleValue {}

extension DawnCompatible {
    /// Gets a namespace holder for Dawn compatible types.
    public var da: DawnWrapper<Self> {
        get { return DawnWrapper(self) }
        set { }
    }
}

extension DawnCompatibleValue {
    /// Gets a namespace holder for Dawn compatible types.
    public var da: DawnWrapper<Self> {
        get { return DawnWrapper(self) }
        set { }
    }
}

extension UIView: DawnCompatible {}
